home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000000_icon-group-sender_Fri Jan 3 12:44:03 2003.msg next >
Internet Message Format  |  2003-12-22  |  16KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h03JgQA12857
  4.     for icon-group-addresses; Fri, 3 Jan 2003 12:42:26 -0700 (MST)
  5. Message-Id: <200301031942.h03JgQA12857@baskerville.CS.Arizona.EDU>
  6. From: icon-project@cs.arizona.edu
  7. X-Newsgroups: comp.lang.icon,comp.answers,news.answers
  8. Subject: Icon Programming Language FAQ
  9. Date: 3 Jan 2003 08:02:52 -0700
  10. To: icon-group@cs.arizona.edu
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13.  
  14. Archive-name: comp-lang-icon-faq
  15. Posting-Frequency: monthly
  16.  
  17.  
  18.         Frequently Asked Questions about the Icon programming language
  19.  
  20.    www.cs.arizona.edu/icon/faq.htm
  21.    Last updated October 14, 2002
  22.  
  23.    Learning about Icon
  24.    A1. What is Icon?
  25.    A2. What is Icon good for?
  26.    A3. What are Icon's distinguishing characteristics?
  27.    A4. What is the Icon program library?
  28.    A5. Where can I learn more about Icon?
  29.    A6. How about comprehensive documentation?
  30.  
  31.    Implementations
  32.    B1. What platforms support Icon?
  33.    B2. How do I get started with Icon?
  34.    B3. Is there a Unicode version of Icon?
  35.    B4. What happened to the compiler?
  36.  
  37.    Administration
  38.    C1. What is the Icon Project?
  39.    C2. How often is the on-line material updated?
  40.    C3. Where did Icon come from?
  41.    C4. Where is Icon going? 
  42.  
  43.    Support
  44.    D1. Is there a users' group for Icon?
  45.    D2. How do I get technical support?
  46.  
  47.    Programming
  48.    E1. Why doesn't read() work with every?
  49.    E2. Why doesn't string invocation such as "foo"() work?
  50.    E3. How can I call a C function?
  51.    E4. Can I open a bidirectional pipe?
  52.      _________________________________________________________________
  53.  
  54. Learning about Icon
  55.  
  56.   A1. What is Icon?
  57.  
  58.    Icon is a very high level general-purpose programming language with
  59.    extensive features for processing strings (text) and data structures.
  60.    Icon is an imperative, procedural language with a syntax that is
  61.    reminiscent of C and Pascal, but with semantics at a much higher
  62.    level.
  63.  
  64.    Icon has a novel expression-evaluation mechanism that integrates
  65.    goal-directed evaluation and backtracking with conventional control
  66.    structures. It has a string scanning facility for pattern matching
  67.    that avoids the tedious details usually associated with analyzing
  68.    strings. Icon's built-in data structures include sets and tables with
  69.    associative lookup, lists that can be used as vectors or stacks and
  70.    queues, and records.
  71.  
  72.    Icon is a strongly, though not statically, typed language. It provides
  73.    transparent automatic type conversion: For example, if an integer is
  74.    used in an operation that requires a string, the integer is
  75.    automatically converted to a string.
  76.  
  77.    Several implementations of Icon have high-level graphics facilities
  78.    with an easily programmed window interface.
  79.  
  80.    Icon manages storage automatically. Objects are created as needed
  81.    during program execution and space is reclaimed by garbage collection
  82.    as needed. The sizes of strings and data structures are limited only
  83.    by the amount of available memory.
  84.  
  85.   A2. What is Icon good for?
  86.  
  87.    As a general-purpose programming language with a large computational
  88.    repertoire, Icon can be used for most programming tasks. It's
  89.    especially strong at building software tools, for processing text, and
  90.    for experimental and research applications.
  91.  
  92.    Icon is designed to make programming easy; it emphasizes the value of
  93.    programmer's time and the importance of getting programs to work
  94.    quickly. Consequently, Icon is used both for short, one-shot tasks and
  95.    for very complex applications.
  96.  
  97.   A3. What are Icon's distinguishing characteristics?
  98.  
  99.      * A high-level, general-purpose programming language
  100.      * Friendly line-oriented syntax (no semicolons needed)
  101.      * Emphasis on programmer productivity
  102.      * Usually interpreted
  103.  
  104.      * Evolved from programming languages (vs. scripting languages)
  105.      * Procedural control flow plus generators and goal-directed
  106.        evaluation
  107.  
  108.      * Values have types; variables are typeless, accept any value
  109.      * Static scoping: global or (procedure) local
  110.      * Automatic garbage collection
  111.  
  112.      * All integers have arbitrary precision
  113.      * Uses strings (not chars) as basic text datatype
  114.      * Has lists that function as arrays, queues, and stacks
  115.      * Also has sets, tables, records (structs), reals (doubles), more
  116.      * No second-class "primitive types"
  117.  
  118.      * Not "object-oriented" (no classes, inheritance, or instance
  119.        methods)
  120.      * No exception catching
  121.      * No concurrency (no threads, monitors, semaphores, or
  122.        synchronization)
  123.      * Has co-expressions (coroutines)
  124.  
  125.      * Basic least-common-denominator system interface (a la ANSI C)
  126.  
  127.      * Procedural graphics (event-driven paradigm available but not
  128.        mandated)
  129.      * Retained windows (programs are never called to repaint)
  130.      * Simple GUI builder that can re-edit its generated code
  131.      * Turtle graphics package
  132.  
  133.      * Large library of contributed procedures and programs
  134.  
  135.   A4. What is the Icon program library?
  136.  
  137.    The library is a collection of programs and procedures written in
  138.    Icon. User contributions are welcome and form a significant portion of
  139.    the library.
  140.  
  141.    Library procedures effectively augment the built-in functions
  142.    available to an Icon program. A wide variety of procedures currently
  143.    exists, and most graphically-based programs are built around library
  144.    procedures.
  145.  
  146.    The programs in the library range from simple demonstrations to handy
  147.    tools to complex graphical applications.
  148.  
  149.    The library is a resource for both new and experienced programmers. In
  150.    addition to their basic utility, its programs and procedures serve as
  151.    examples of how things can be written in Icon.
  152.  
  153.   A5. Where can I learn more about Icon?
  154.  
  155.    Here are some good places to start.
  156.      * Ralph Griswold's overview: www.cs.arizona.edu/icon/docs/ipd266.htm
  157.      * Dave Hanson's introduction: www.cs.arizona.edu/icon/intro.htm
  158.      * John Shipman's tutorial: www.nmt.edu/tcc/help/lang/icon
  159.  
  160.   A6. How about comprehensive documentation?
  161.  
  162.    Two books define the Icon language. The core language is covered in
  163.    The Icon Programming Language (third edition), by Griswold and
  164.    Griswold. Graphics facilities are described in Graphics Programming in
  165.    Icon by Griswold, Jeffery, and Townsend. These books contain both
  166.    tutorial and reference material.
  167.  
  168.    Icon's internals are detailed in The Implementation of the Icon
  169.    Programming Language by Griswold and Griswold. Although considerable
  170.    changes have occurred since Version 6, described in the book, the
  171.    basic structure of Icon remains the same. Two technical reports,
  172.    IPD112 and IPD239, describe subsequent changes.
  173.  
  174.    The Language and Graphics books are available from RTC Books
  175.    (www.rtcbooks.com, search for "Icon") or from Jeffery Systems
  176.    (www.zianet.com/jeffery/books). The Language and Implementation books
  177.    can be downloaded at no charge from the Icon books page,
  178.    www.cs.arizona.edu/icon/books.htm.
  179.  
  180.    The Icon Programming Language Handbook, by Thomas W. Christopher, is
  181.    available on the web at www.toolsofcomputing.com/IconHandbook.
  182.  
  183.    There is a large amount of additional information at the Icon web
  184.    site, www.cs.arizona.edu/icon.
  185.      _________________________________________________________________
  186.  
  187. Implementations
  188.  
  189.   B1. What platforms support Icon?
  190.  
  191.    Current implementations with graphics support are available for Unix
  192.    and Windows. On the Apple Macintosh, Icon runs in the Unix development
  193.    environment of MacOS X, with graphics using XFree86. Older versions of
  194.    Icon are available for some other systems. An alternative Java-based
  195.    implementation for Unix, Jcon, is also available.
  196.  
  197.   B2. How do I get started with Icon?
  198.  
  199.    Version 9.4.1 of Icon for Unix can be downloaded from
  200.    www.cs.arizona.edu/icon/v941. Source and binary packages are
  201.    available, each with the complete Icon program library.
  202.  
  203.    Version 9.3 of Icon for Windows is compatible at the source level with
  204.    version 9.4.1. It can be downloaded from
  205.    www.cs.arizona.edu/icon/v93w.htm. The Version 9.4.1 library can be
  206.    obtained separately from www.cs.arizona.edu/icon/v941.
  207.  
  208.    For older implementations, start at
  209.    www.cs.arizona.edu/icon/implver.htm. Jcon is at
  210.    www.cs.arizona.edu/icon/jcon.
  211.  
  212.   B3. Is there a Unicode version of Icon?
  213.  
  214.    No. Icon is defined in terms of 8-bit characters, and changing this
  215.    presents several design challenges that would likely break existing
  216.    programs. Also, modifying the C implementation is probably infeasible,
  217.    but a Unicode version of Jcon might be possible.
  218.  
  219.   B4. What happened to the compiler?
  220.  
  221.    For a while, Unix distributions included both an interpreter and a
  222.    compiler; but the interpreter is is usually fast enough even for
  223.    production work, and most people found that using the compiler wasn't
  224.    worth the extra compilation time or the hassles involved. We no longer
  225.    advertise the compiler or produce binaries for it. It is still part of
  226.    the source code distribution, and we have not deliberately broken it,
  227.    but we no longer support it and we cannot offer help if problems
  228.    arise.
  229.      _________________________________________________________________
  230.  
  231. Administration
  232.  
  233.   C1. What is the Icon Project?
  234.  
  235.    The Icon Project is a name used by the group that distributes and
  236.    supports the Icon programming language. The project maintains the Icon
  237.    web site at www.cs.arizona.edu/icon. A non-commercial organization,
  238.    the project is supported by the Department of Computer Science at the
  239.    University of Arizona.
  240.  
  241.   C2. How often is the on-line material updated?
  242.  
  243.    New material is added when it's available. Established implementations
  244.    usually are updated only when there's a new version. This typically is
  245.    every year or two. The Icon program library is updated on a similar
  246.    schedule.
  247.  
  248.   C3. Where did Icon come from?
  249.  
  250.    Icon is the latest in a series of high-level programming languages
  251.    designed to facilitate programming tasks involving strings and
  252.    structures. The original language, SNOBOL, was developed at Bell
  253.    Telephone Laboratories in the early 1960s. SNOBOL evolved into
  254.    SNOBOL4, which is still in use. Subsequent languages were developed at
  255.    the University of Arizona with support from the National Science
  256.    Foundation. Although it has similar objectives and many similar
  257.    capabilities, Icon bears little superficial resemblance to SNOBOL4.
  258.  
  259.    Icon implementations were developed by faculty, staff, and students at
  260.    the University of Arizona, with significant contributions from
  261.    volunteers around the world. An Icon history by Ralph and Madge
  262.    Griswold appears in the preprints of the second History of Programming
  263.    Languages Conference (HOPL-II), ACM SIGPLAN Notices, March 1993 (Vol
  264.    28, No 3).
  265.  
  266.    The name Icon is not an acronym, nor does it stand for anything in
  267.    particular, although the word iconoclastic was mentioned when the name
  268.    was chosen. The name predates the now common use of icon to refer to
  269.    small images used in graphical user interfaces. This sometimes
  270.    misleads people into thinking that that Icon is designed to create or
  271.    manipulate icons, but there's no good solution to that problem.
  272.  
  273.   C4. Where is Icon going?
  274.  
  275.    We continue to use Icon on a daily basis, but no significant changes
  276.    are planned. We expect to support the Unix version for the forseeable
  277.    future, and to distribute ports to other systems as supplied by
  278.    volunteers.
  279.  
  280.    The Unicon project is developing an object-oriented language based on
  281.    Icon. For more information, see unicon.sourceforge.net. An earlier
  282.    object-oriented extension to Icon, Idol, can be found in the Icon
  283.    program library.
  284.      _________________________________________________________________
  285.  
  286. Support
  287.  
  288.   D1. Is there a users' group for Icon?
  289.  
  290.    There is no official Icon users' group, but The Icon Project maintains
  291.    a moderated "Icon-group" electronic mailing list. To subscribe (or
  292.    unsubscribe), send a message to icon-group-request@cs.arizona.edu.
  293.  
  294.    There is a gateway between Icon-group and comp.lang.icon, an
  295.    unmoderated newsgroup for discussing issues related to Icon. The
  296.    gateway, which exchanges messages between the two systems, is
  297.    imperfect and not under the control of the Icon Project.
  298.  
  299.    The newsgroup generally provides faster response than the mailing list
  300.    and is less intrusive, but it sometimes suffers from inappropriate
  301.    postings. The Icon Project usually sends its announcements and other
  302.    messages to the mailing list.
  303.  
  304.   D2. How do I get technical support?
  305.  
  306.    The Icon Project is not a commercial organization, and its capacity
  307.    for providing technical support is limited. Please use the appropriate
  308.    resource when you need assistance:
  309.      * For programming assistance, submit a query to the mailing list or
  310.        newsgroup (see above).
  311.      * For porting assistance or Unix problems, contact
  312.        icon-project@cs.arizona.edu.
  313.      * For problems with the Windows implementation, contact the
  314.        implementor, jeffery@cs.nmsu.edu.
  315.      * For general information and additional documentation, visit the
  316.        Icon web site: www.cs.arizona.edu/icon.
  317.      _________________________________________________________________
  318.  
  319. Programming
  320.  
  321.   E1. Why doesn't read() work with every?
  322.  
  323.    every s := read() do {...} doesn't loop because read() produces a
  324.    single value and then fails if resumed. Other "consumer" procedures
  325.    such as get() and pop() work the same way. Use a while loop with these
  326.    procedures, and save every for use with generators such as !x or
  327.    key(T).
  328.  
  329.   E2. Why doesn't string invocation such as "foo"() work?
  330.  
  331.    String invocation works if the procedure is present; the catch is that
  332.    the linker removes unreferenced procedures. To ensure a procedure's
  333.    presence, reference it in the main() procedure. A simple reference
  334.    suffices, as in refs := [foo, bar, baz]; it's not necessary to
  335.    actually call it.
  336.  
  337.    (Why does the linker remove unreferenced procedures? Because this can
  338.    save huge amounts of memory for programs that use the library.)
  339.  
  340.   E3. How can I call a C function?
  341.  
  342.    You can't call an arbitrary C function, but if you're willing to write
  343.    a function to Icon's specifications, there are two approaches. Under
  344.    Unix, which provides loadfunc(), you can load one or more functions
  345.    from a shared library, and then treat them as if they had been written
  346.    in Icon. Some examples can be found in the cfuncs and packs/loadfuncs
  347.    directories of the Icon program library. The more cumbersome approach
  348.    is to add code to the Icon interpreter and rebuild it; some hooks are
  349.    provided for this purpose. Both approaches are discussed in Calling C
  350.    Functions from Icon, www.cs.arizona.edu/icon/docs/ipd240.htm.
  351.  
  352.    The Jcon implementation allows Icon programs to call Java code that is
  353.    written to Jcon specifications.
  354.  
  355.   E4. Can I open a bidirectional pipe?
  356.  
  357.    No, this is not possible. Although the concept is simple -- write a
  358.    line to a program via a pipe, then read that program's output -- it
  359.    probably wouldn't work. Most I/O libraries don't write anything to a
  360.    pipe until they've filled a buffer, and the most likely consequence
  361.    would be a deadlock, with each program waiting for the other to send
  362.    more data.
  363.      _________________________________________________________________
  364.  
  365.    This FAQ is edited by Gregg Townsend. It includes contributions from
  366.    Ralph Griswold, Cliff Hathaway, Clint Jeffery, Bob Alexander, and Todd
  367.    Proebsting.
  368.